﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentApartMentManage
{
    public partial class DMS : Form
    {
        public DMS()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("你真的要清空输入的信息吗", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                textBox1.Clear();
                textBox2.Clear();
                
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string sql = string.Format("select * from 公寓维修管理表 where 公寓楼号 like '{0}%' and 公寓号 like '{1}%'", textBox1.Text.Trim(), textBox2.Text.Trim());
                dataGridView1.DataSource = DataShow.show(sql);
                MessageBox.Show("查询成功!");
                return;
            }catch(Exception ex)
            {
                MessageBox.Show("查询失败!");
                return;
            }
            
        }
    }
}
